package net.oschina.app.cwq;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import net.oschina.app.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Lenovo on 2017/07/15.
 */

public class DiscoverAvtivityView extends AppCompatActivity {
    @BindView(R.id.news_tablayout)
    TabLayout newsTablayout;
    @BindView(R.id.news_vp)
    ViewPager newsVp;
    @BindView(R.id.iv_return)
    ImageView ivReturn;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.discover_activity_view);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {

        //ViewPager相关
        MainAdapter mainAdapter = new MainAdapter(getSupportFragmentManager());
        newsVp.setAdapter(mainAdapter);

        // TabLayout 关联ViewPager
        newsTablayout.setupWithViewPager(newsVp);

    }


    @OnClick(R.id.iv_return)
    public void onViewClicked() {
        finish();
    }
}
